package com.mopa.shopping.controlador;

 
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import com.mapa.dao.DAO;
import com.mopa.shopping.entidades.Usuario;
 
@RequestScoped
@ManagedBean
public class Teste {
     
    @PostConstruct
    public void init(){
        System.out.println(" Bean executado! ");
        
    }
     
    public String getMessage(){
        return "Hello World JSF!";
    }
    public void salvar(){
    	DAO dao = new DAO();
    	Usuario u = new Usuario();
    	u.setLogin("carlos.alberto");
    	u.setSenha("mopa123");
    	dao.salvar(u);
    }
}